package org.abettor.util.security.cert;

import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;

import javax.net.ssl.X509TrustManager;

/**
 * 证书信任管理类，此类会信任任何证书
 * @author <a href="http://www.abettor.org/" target="_blank">abettor</a>
 * @deprecated
 */
public class X509TrustAll implements X509TrustManager
{
	/**
	 * 检查客户端的证书，若不信任该证书则抛出异常。这里不做任何处理，全部信任。
	 */
	public void checkClientTrusted(X509Certificate[] arg0, String arg1)
		throws CertificateException
	{
		return;
	}

	/**
	 * 检查服务器的证书，若不信任该证书同样抛出异常。这里不做任何处理，全部信任。
	 */
	public void checkServerTrusted(X509Certificate[] arg0, String arg1)
		throws CertificateException
	{
		return;
	}

	/**
	 * 返回所有受信任的证书。
	 * @see javax.net.ssl.X509TrustManager#getAcceptedIssuers()
	 */
	public X509Certificate[] getAcceptedIssuers()
	{
		return null;
	}
}
